<!DOCTYPE html>
<html>

<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">


    <title>ZDH - 登录</title>
    <meta name="keywords" content="ZDH,响应式后台">
    <meta name="description" content="ZDH，基于Bootstrap3最新版本开发的扁平化主题，她采用了主流的左右两栏式布局，使用了Html5+CSS3等现代技术">

    <link rel="shortcut icon" href="img/favicon.ico">
    <link href="css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link href="css/font-awesome.css?v=4.4.0" rel="stylesheet">

    <link href="css/animate.css" rel="stylesheet">
    <link href="css/style.css?v=4.1.0" rel="stylesheet">
    <!--[if lt IE 9]>
    <meta http-equiv="refresh" content="0;ie.html"/>
    <![endif]-->
    <script>if (window.top !== window.self) {
        window.top.location = window.location;
    }</script>
</head>

<body class="gray-bg">

<div class="middle-box text-center loginscreen  animated fadeInDown">
    <div>
        <div>

            <h1 class="logo-name">ZD</h1>

        </div>
        <h3>欢迎使用ZDH</h3>

        <form id="login" method="post" class="m-t" role="form" action="">
            <div class="form-group">
                <input id="username" name="username" type="text" class="form-control" placeholder="用户名" required="">
            </div>
            <div class="form-group">
                <input id="password" name="password" type="password" class="form-control" placeholder="密码" required="">
            </div>
            <button type="submit" class="btn btn-primary block full-width m-b">登 录</button>


            <p class="text-muted text-center"><a id="retrieve_password" href="javascript:void(0);"
                                                 onclick="retrieve_password()">
                <small>忘记密码了？</small>
            </a> | <a href="register.html">注册一个新账号</a>
            </p>

        </form>
    </div>
</div>

<!-- 全局js -->
<script src="js/jquery.min.js?v=2.1.4"></script>
<script src="js/bootstrap.min.js?v=3.3.6"></script>
<!-- layer javascript -->
<script src="js/plugins/layer/layer.min.js"></script>
<script>

    function retrieve_password() {

        var index=layer.load(1, {
            shade: [0.1,'#fff'] //0.1透明度的白色背景
        });

        $.ajax({
            type: 'POST',
            url: "retrieve_password",
            dataType: 'json',
            data: $("#login").serialize(),
            //成功返回
            success: function (data) {
                layer.close(index)
                layer.msg(data.value)
            },
            //处理完成
            complete: function () {
                layer.close(index)
                console.info("complete")
            },
            //报错
            error: function (data) {
                console.info("error: " + data.responseText);
                layer.msg("出现异常:" + data.responseText)
            }
        });


    }


</script>

</body>

</html>
